# -*- coding: utf-8  -*-
#!/usr/local/bin/python

__author__ = 'jian.yao'

from django.utils.translation import  ugettext as _

BASE_ERROR_CODE = 0x000000

class ERROR_CODE:
    '''
    class that gives difinition of error code
    '''
    UNKNOWN_ERROR                       = BASE_ERROR_CODE + 0
    SUCCESS                             = BASE_ERROR_CODE + 1
    FAILURE                             = BASE_ERROR_CODE + 2
    PARAMETERS_ERROR                    = BASE_ERROR_CODE + 3
    USERNAME_ALREADY_EXIST              = BASE_ERROR_CODE + 4
    NICKNAME_ALREADY_EXIST              = BASE_ERROR_CODE + 5
    NOT_IMPLEMENTED                     = BASE_ERROR_CODE + 6
    INVALID_USERNAME                    = BASE_ERROR_CODE + 7
    INCORRECT_USERNAMEORPASSWORD        = BASE_ERROR_CODE + 8
    NAME_IS_NULL                        = BASE_ERROR_CODE + 9
    COMMODITY_ALREADY_EXIST             = BASE_ERROR_CODE + 10

class ERROR_MESSAGE:
    UNKNOWN_ERROR                       = _('Unexpected error.')
    SUCCESS                             = _('Successful.')
    FAILURE                             = _('Failure.')
    PARAMETERS_ERROR                    = _('Params error.')
    USERNAME_ALREADY_EXIST              = _('Username already existed.')
    NICKNAME_ALREADY_EXIST              = _('Nickname already existed.')
    NOT_IMPLEMENTED                     = _('Not Implemented.')
    INVALID_USERNAME                    = _('Sorry, username you input is with wrong format!')
    INCORRECT_USERNAMEORPASSWORD        = _('Incorrect password or username.')
    NAME_IS_NULL                        = _('name is null.')
    COMMODITY_ALREADY_EXIST             = _('commodity already existed.')

